refactor: Moving tsup flags into config file and online logic to parent class, introducing @wdio/elements README#230
Merged
Conversation
…@wdio/elements - Adding README
f70cfa0 to
a3b8228
Compare
…pters - Removing postbuild: pnpm pack - Merging ROADMAP with SIMPLIFY_DEBT
a3b8228 to
0026281
Compare
vishnuv688
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three refactors to reduce duplication, plus packaging readiness for
@wdio/elements:onLineconsole-log accumulation moves intoSessionCapturerBase. Three adapters had identical overrides; now the base class handles it.inUiAutomatorScopecomputed once ingetSuggestedLocatorsinstead of independently in two helpers.@wdio/elementsgets a README,publishConfig, and"files"field for npm publishing. tsup flags extracted totsup.config.ts.Why
The
onLineoverride in every adapter was pure copy-paste — each didcreateConsoleLogEntry+push+sendUpstream, identical to the base except the base was missing thepush. Same story forinUiAutomatorScope: same inputs, same result, computed twice. This is the "if the same change would land in 2+ adapters, it belongs in core" rule from CLAUDE.md §3.@wdio/elementsis being published; it needs a README and correct packaging metadata.How
SessionCapturerBase.onLine()already calledcreateConsoleLogEntryandsendUpstream; it now also pushes tothis.consoleLogs. Three adapter overrides deleted along with their now-unused imports (LogSource,LogLevel,createConsoleLogEntry).inUiAutomatorScopeis computed once at thegetSuggestedLocatorslevel and threaded intogetSimpleSuggestedLocators/getComplexSuggestedLocatorsas a parameter.trace-exporter.ts:buildTraceBundlereads the context title from the tracedContextOptionsEventrather than re-deriving it from capabilities viaresolveContextNaming..npmignorereplaced by"files": ["dist", "README.md"]inpackage.json.Architecture self-check
CLAUDE.md§7 is being resolved.)service,nightwatch-devtools, orselenium-devtoolsimports from another adapter.backend/app. Neither package reaches into adapter internals.fetch(...),ws.send(...), or HTTP route has a typed request/response shape inshared(or inservicetypes ifshareddoesn't exist yet, with a TODO to move).if (framework === '...')outside an adapter. Framework branching uses a typedFrameworkId.anyat package boundaries. Internalanyis acceptable only at a documented framework-edge with a one-line comment.Multi-adapter changes
Debt scoreboard
If new debt is introduced, it must be added to
CLAUDE.md§7 in this PR.Testing
shared/core(required perCLAUDE.md§4).CLAUDE.md§4).pnpm buildpasses.pnpm testpasses.pnpm lintpasses.example/(orexamplefor the framework I changed).If any required item is skipped, say so here with the reason:
<your note, or "n/a">
Screenshots / recordings (UI changes only)